package com.zxmr.rabbit;

import java.util.Timer;
import java.util.concurrent.atomic.AtomicBoolean;

import com.zxmr.timer.ReEstablishConnection;

public class ConnectionManager {

	static AtomicBoolean running = new AtomicBoolean();
	
	public static void resetConnection()
	{
		if(running.compareAndSet(false, true))
		{
			ReEstablishConnection task = new ReEstablishConnection(2000);
			Timer timer = new Timer();
			timer.schedule(task, 0);
		}
	}
	public static void resetConnectionComplete()
	{
		running.compareAndSet(true, false);
	}
}
